package week4.monday.two;

/**
 * @Package: week4.monday.two
 * @Author: yanjiali
 * @Created: 2024/3/18 21:51
 */
public class Rectangle extends Diagram{

    private double length;

    private double weight;

    public Rectangle() {

    }

    public  Rectangle(double length, double weight) {
        this.weight = weight;
        this.length = length;
    }

    @Override
    public void draw() {
        super.draw();
    }

    /**
     * 计算面积
     * @return
     */
    public double getArea() {
        return this.length * this.weight;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
}
